package com.zyk.leetcode;

import java.util.Arrays;

/**
 * @author zhangsan
 * @date 2021/4/16 21:35
 */
public class C1502 {

    // https://leetcode-cn.com/problems/can-make-arithmetic-progression-from-sequence/
    public static boolean canMakeArithmeticProgression(int[] arr) {
        Arrays.sort(arr);
        for (int i = 1; i < arr.length - 1; i++)
            if (arr[i] * 2 != arr[i - 1] + arr[i + 1]) return false;
        return true;
    }


    // for test
    public static void main(String[] args) {

    }


}
